ModuleNotFoundError: No module named 'debugpy' · Issue #1148 · microsoft/debugpy · GitHub | 您所在的位置:网站首页 › modulenotfounderror no module named chart_studio › ModuleNotFoundError: No module named 'debugpy' · Issue #1148 · microsoft/debugpy · GitHub |
Environment data
debugpy version: 1.6.4
OS and version: VSCode devcontainer mcr.microsoft.com/devcontainers/python:3.8
Python version: 3.8.15
Using VS Code or Visual Studio: VSCode 1.74.0 (commit 5235c6bb189b60b01b1f49062f4ffa42384f8c91)
Actual behavior
Debugging Flask apps throws a ModuleNotFoundError, even with a minimal application. This happens both when I use the built-in debugger config, or create my own via launch.json. The terminal output is: /usr/bin/env /usr/local/bin/python /home/vscode/.vscode-server/extensions/ms-python.python-2022.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 56505 -- /workspaces/debug-repro-folder/main.py * Serving Flask app 'main' * Debug mode: on WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on http://127.0.0.1:5000 Press CTRL+C to quit * Restarting with stat 0.17s - Error importing debugpy._vendored.force_pydevd (with sys.path entry: '/home/vscode/.vscode-server/extensions/ms-python.python-2022.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/..') Traceback (most recent call last): File "/home/vscode/.vscode-server/extensions/ms-python.python-2022.20.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_defaults.py", line 60, in on_pydb_init __import__(module_name) ModuleNotFoundError: No module named 'debugpy' * Debugger is active! * Debugger PIN: 499-018-249This a new phenomenon that I'm only getting with this latest VSCode release. Expected behaviorDebugging a flask app should not throw an error. While in this minimal case, the debugger and server keep running despite the error, some higher level apps that use Flask under the hood (e.g. Dash) catch this error and stop themselves. Steps to reproduce: Clone this repo https://github.com/korompaiistvan/py-debug-repro (alternatively: install py3.8 and flask and just download the main.py file from the repo) Open VSCode and install the ms-vscode-remote.remote-containers extension (requires Docker to be installed) Run the "Dev Containers: Rebuild and Reopen in Container" command Wait for Flask and the extensions to be installed. You might have to reload the window in order for Pylance to stop complaining. Finally, open up main.py and use the default Python debugger to run it. |
CopyRight 2018-2019 实验室设备网 版权所有 |